// API
import request from '@/api/request'

export default {
  list () {
    return request({
      url: '/list',
      method: 'GET'
    })
  },
  options () {
    return request({
      url: '/options',
      method: 'GET'
    })
  },
  preview (data) {
    const formData = new FormData()
    Object.keys(data).forEach(key => formData.append(key, data[key]))
    return request({
      url: '/preview',
      method: 'POST',
      data: formData
    })
  },
  wordToHtmlFile (data) {
    const formData = new FormData()
    Object.keys(data).forEach(key => formData.append(key, data[key]))
    return request({
      url: '/office/word/to/html/file',
      method: 'POST',
      app: 'APP_API2',
      data: formData
    })
  },
  wordToHtmlUrl (url) {
    return request({
      url: '/office/word/to/html/url?url=' + url,
      method: 'GET',
      app: 'APP_API2'
    })
  }

}
